Skip to content

Fix race condition in waitForPopupClose#37

Merged
JGJP merged 1 commit intomasterfrom
fix/wait-for-popup-close-race
Apr 7, 2026
Merged

Fix race condition in waitForPopupClose#37
JGJP merged 1 commit intomasterfrom
fix/wait-for-popup-close-race

Conversation

@JGJP
Copy link
Copy Markdown
Contributor

@JGJP JGJP commented Apr 2, 2026

Summary

  • Guard waitForPopupClose with popup.isClosed() before calling waitForEvent('close')
  • If the popup already closed before the call, waitForEvent hangs forever since the event already fired
  • This matches the pattern already used in approveSDKPopup

Context

Flaky sdk-e2e / google CI failures in superapp: on retry #1, beforeAll calls waitForPopupClose(sdkPopup) after Google OAuth, but the popup has already closed → 60s timeout → personal_sign test marked failed (0ms, body never ran).

Example: https://github.com/StartaleGroup/superapp/actions/runs/23883580601/job/69641946564?pr=1273

If the popup closes before waitForPopupClose is called,
waitForEvent('close') hangs forever because the event already fired.
Add isClosed() guard to handle this case — matches the pattern
already used in approveSDKPopup.

Fixes flaky beforeAll timeout in sdk-e2e google tests.
@JGJP JGJP merged commit b8a2d06 into master Apr 7, 2026
3 checks passed
@JGJP JGJP deleted the fix/wait-for-popup-close-race branch April 7, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants